home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / libs / amigametafile.lha / AmigaMetaFormat / Docs / amigametaformat.doc < prev   
Text File  |  1997-05-04  |  7KB  |  201 lines

  1. TABLE OF CONTENTS
  2.  
  3. amigametaformat.library/--background--
  4. amigametaformat.library/AmfOpen
  5. amigametaformat.library/AmfFunction
  6. amigametaformat.library/AmfClose
  7.  
  8. amigametaformat.library/--background--        amigametaformat.library/--background--
  9.  
  10.   PURPOSE
  11.       The amigametaformat.library let you draw in a virtual space AND
  12.       map this TO any outputdevice, like window, rastport, metafile etc.
  13.       library-version: 6.0
  14.  
  15.  
  16. amigametaformat.library/AmfOpen               amigametaformat.library/AmfOpen
  17.  
  18.   NAME
  19.       AmfOpen - create a amf structure
  20.  
  21.   SYNOPSIS
  22.       amf = AmfOpen(channel,dataArray);
  23.        D0             A0      D0
  24.  
  25.        APTR AmfOpen(ULONG, ULONG*);
  26.  
  27.   FUNCTION
  28.        This routine allocs memory for the amf structure.
  29.        This routine must be called as the first.
  30.  
  31.   INPUTS
  32.        channel -- outputchannel
  33.                   ( 1 - AMF_WINDOW, 2 - AMF_STRIP, 3 - AMF_FILE, 4 - AMF_REGION,
  34.                     5 - AMF_EPS, 6 - AMF_GEM, 7 - AMF_CGM, 8 - AMF_WW,
  35.                     9 - AMF_HPGL, 10 - AMF_DR2D, 11 - AMF_AI, 12 - AMF_WMF,
  36.                     13 - AMF_JMF )
  37.        dataArray -- array that include the datas for the channel
  38.                     ( CASE channel=AMF_WINDOW
  39.                         [Window    struct window *,
  40.                          cm        struct colormap *]
  41.                       CASE channel=AMF_STRIP
  42.                         [RPort     struct RastPort *,
  43.                          xstart    ULONG,
  44.                          ystart    ULONG,
  45.                          xsize     ULONG,
  46.                          ysize     ULONG,
  47.                          cm        struct colormap *,
  48.                          left      ULONG,
  49.                          top       ULONG,
  50.                          right     ULONG,
  51.                          down      ULONG]
  52.                       CASE channel=AMF_FILE
  53.                         [iff       struct IFFHandle *,
  54.                          xsize     ULONG,
  55.                          ysize     ULONG]
  56.                       CASE channel=AMF_REGION
  57.                         [RPort     struct RastPort *,
  58.                          xstart    ULONG,
  59.                          ystart    ULONG,
  60.                          xsize     ULONG,
  61.                          ysize     ULONG
  62.                          cm        struct colormap *]
  63.                       CASE channel=AMF_EPS
  64.                         [File      filehandle *,
  65.                          xsize     ULONG,
  66.                          ysize     ULONG]
  67.                       CASE channel=AMF_GEM
  68.                         [File      filehandle *,
  69.                          xsize     ULONG,
  70.                          ysize     ULONG]
  71.                       CASE channel=AMF_CGM
  72.                         [File      filehandle *
  73.                          xsize     ULONG,
  74.                          ysize     ULONG]
  75.                       CASE channel=AMF_WW
  76.                         [File      filehandle *
  77.                          xsize     ULONG,
  78.                          ysize     ULONG]
  79.                       CASE channel=AMF_HPGL
  80.                         [File      filehandle *
  81.                          xsize     ULONG,
  82.                          ysize     ULONG]
  83.                       CASE channel=AMF_DR2D
  84.                         [iff       struct IFFHandle *,
  85.                          xsize     ULONG,
  86.                          ysize     ULONG]
  87.                       CASE channel=AMF_AI
  88.                         [iff       struct IFFHandle *,
  89.                          xsize     ULONG,
  90.                          ysize     ULONG]
  91.                       CASE channel=AMF_WMF
  92.                         [iff       struct IFFHandle *,
  93.                          xsize     ULONG,
  94.                          ysize     ULONG]
  95.                       CASE channel=AMF_JMF
  96.                         [iff       struct IFFHandle *,
  97.                          xsize     ULONG,
  98.                          ysize     ULONG]
  99.                     )
  100.  
  101.       - The Window must be opened and the colormap must be valid, example
  102.         screen.viewport.colormap.
  103.         This channel let you draw to a window.
  104.       - The IFFHandle must be initialized, filled with iff_Stream,
  105.         and opened.
  106.         
  107.         if file=open(...)
  108.           {
  109.             if iff=allociff()
  110.               {
  111.                 initiffasdos(iff);
  112.                 iff.stream=file;
  113.                 openiff(iff,ifff_write);
  114.                 if amf=amfopen(3,...)
  115.                 ...
  116.                 freeiff(iff)
  117.               }
  118.             close(file)
  119.           }
  120.         
  121.         xsize and ysize the original size (p.e. 640x400)
  122.         This channel let you save the draw within a IFF-structure. The
  123.         structure have this ID's:
  124.         obsolete  VERS: 2 ULONGs that store the Library-version with
  125.                   first ULONG:  version  (ex: 1)
  126.                   second ULONG  revision (ex: 0)
  127.         FVER  WB 2.0 versionstring ($VER: AmigaMetaFile x.x)
  128.         HEAD  xsize ULONG
  129.               ysize ULONG
  130.         BODY: all functions (except Get... and SetDPI and SetFont to Font)
  131.               are stored in this
  132.               way:
  133.                   BEGIN
  134.                     function-number             ULONG
  135.                     count                       ULONG
  136.                     first data from dataArray   ULONG
  137.                     second data                 ULONG
  138.                     ....
  139.                     (count) data                ULONG
  140.                   END
  141.                   repeated for every called function
  142.       - The RastPort must have a valid bitmap-structure.
  143.  
  144.   RESULT
  145.        amf -- an initialized amf structure, or NULL on failure
  146.  
  147.   NOTES
  148.        The amf structure are private only!
  149.  
  150.   BUGS
  151.        Some channels are still in progress.
  152.  
  153.   FUTURE
  154.  
  155.  
  156. amigametaformat.library/AmfFunction       amigametaformat.library/AmfFunction
  157.  
  158.    NAME
  159.         AmfFunction -- select a amf Function
  160.  
  161.    SYNOPSIS
  162.         result = AmfFunction(amf,dataArray,function,count);
  163.           D0                  A1    A0       D1      D0
  164.  
  165.         ULONG  AmfFunction(APTR, ULONG*, ULONG, ULONG);
  166.  
  167.    FUNCTION
  168.         Select a function from the amf functions and draw the result to
  169.         the opened channel or get the result back.
  170.  
  171.    INPUTS
  172.         amf -- amf struct ready opened with AmfOpen()
  173.         dataArray -- array of ULONG with the needed datas
  174.         function -- amf function defined in amigametafile.const
  175.         count -- counter of ULONGs in dataArray
  176.  
  177.    RESULT
  178.         == NULL   for all draw and set functions, if there was no error
  179.         != NULL for all draw and set functions, if there was a error
  180.  
  181.         RESULT for all get functions
  182.    
  183.    NOTES
  184.         Some functions on some channels are not supported.
  185.  
  186.  
  187. amigametaformat.library/AmfClose             amigametaformat.library/AmfClose
  188.  
  189.    NAME
  190.         AmfClose -- free amf struct
  191.  
  192.    SYNOPSIS
  193.         AmfClose(amf);
  194.                   D0
  195.  
  196.         VOID AmfClose(APTR)
  197.  
  198.    FUNCTION
  199.         Free all memory allocated for amf structure.
  200.  
  201.